﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using S.Authorization.API.Application.Command.OrganizationCommand;

namespace S.Authorization.API.Controllers.Organization
{
    [Route("api/[controller]")]
    [ApiController]
    public class DepartmentController : ControllerBase
    {
        private IMediator mediator;
        public DepartmentController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 新增部门
        /// </summary>
        /// <returns></returns>
        /// 
        [HttpPost("AddDepartment")]
        public async Task<IActionResult> AddDepartment(DepartmentCreateCommand column)
        {
            var result = await mediator.Send(column);
            return Ok(result);
        }
    }
}
